package cn.xej.demo.service.impl;

import cn.xej.demo.Fish;
import cn.xej.demo.User;
import cn.xej.demo.service.CarService;
import cn.xej.demo.service.UserService;
import org.springframework.stereotype.Service;

/**
 * @Author alicat.xu
 * @Date 2021/10/13 3:47 下午
 */
@Service
public class User2ServiceImpl implements UserService {
    private String name = "user2";

//    static {
//        System.out.println("User2ServiceImpl....");
//    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Override
    public String toString() {
        return "User2ServiceImpl{" +
                "name='" + name + '\'' +
                '}';
    }


    @Override
    public User run(CarService carService) {
        System.out.println("User2ServiceImpl ..... carService "+carService);
        carService.getCar(new Fish());
        return new User();
    }

    @Override
    public String getType() {
        return "user2Service";
    }
}
